#include "settingmanage.h"

SettingManage* SettingManage::m_instance = nullptr;

SettingManage::SettingManage(QObject *parent)
    :QObject(parent)
{
    m_pSettings = new QSettings("C:/Users/shafl/Desktop/FrameWork/config.ini",QSettings::IniFormat,this);
}

SettingManage::~SettingManage()
{
    delete m_pSettings;
}

void SettingManage::setValue(const QString &key, const QVariant &value)
{
    m_pSettings->setValue(key, value);
}

QVariant SettingManage::getValue(const QString &key, const QVariant &defaultValue) const
{
    return m_pSettings->value(key, defaultValue);
}

bool SettingManage::contains(const QString &key) const
{
    return m_pSettings->contains(key);
}

void SettingManage::remove(const QString &key)
{
    m_pSettings->remove(key);
}

void SettingManage::sync()
{
    m_pSettings->sync();
}

